﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BattleshipGameClient
{
    public partial class RequestForm : Form
    {
        public static Connection conn;
        Uri uri;
        bool isFirstShooter;
        public RequestForm(Uri uri, String name, bool isFirstShooter, Connection conn)
        {
            InitializeComponent();
            RequestForm.conn = conn;
            this.uri = uri;
            this.isFirstShooter = isFirstShooter;
            messageLabel.Text = name + " wants to play with you.";
        }

        private void btnDeny_Click(object sender, EventArgs e)
        {
            conn.selfDenyNewGame(uri);
            this.Close();
        }

        private void btnAccept_Click(object sender, EventArgs e)
        {
            conn.selfAcceptNewGame(uri,isFirstShooter);
            this.Close();

        }
    }
}
